package com.core.gig.negocio;


import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name = "TB_USUARIO")
@SequenceGenerator(name = "SQ_USUARIO", sequenceName = "SQ_USUARIO")
public class Usuario implements Serializable
{
	private static final long serialVersionUID = -4180930571378838346L;
	private int id;
	private String usuario;
	private String email;
	private String senha;
	private Collection<Orcamento> orcamentos;

	@Id
	@Column (name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_USUARIO")
	public int getId()
	{
		return id;
	}

	@Column(name = "USUARIO", nullable = false, length = 20)
	public String getUsuario()
	{
		return usuario;
	}

	@Column(name = "EMAIL", nullable = true, length = 100)
	public String getEmail()
	{
		return email;
	}

	@Column(name = "SENHA", nullable = false, length = 10)
	public String getSenha()
	{
		return senha;
	}

	@OneToMany(mappedBy = "usuario")
	public Collection<Orcamento> getOrcamentos()
	{
		return orcamentos;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public void setUsuario(String usuario)
	{
		this.usuario = usuario;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public void setSenha(String senha)
	{
		this.senha = senha;
	}

	public void setOrcamentos(Collection<Orcamento> orcamentos)
	{
		this.orcamentos = orcamentos;
	}
}